#ifndef INSTRUCTION_H
#define INSTRUCTION_H

#include <map>
#include <string>
#include <vector>

#include "tpe.h++"

class Instruction {
	public:
		Instruction(const std::string&, const size_t&, const Tryte_t&, const std::vector<std::string>&);
		std::string getLocation() const;
		std::vector<std::string> getTokens() const;
		Tryte_t getSize() const;
		std::string assemble() const;
		std::string dump() const;
		static void addSymbol(const std::string&, const Tryte_t&);
		static std::string dumpSymbols();
	protected:
		std::string filename_;
		size_t lineNo_;
		Tryte_t address_;
		std::vector<std::string> tokens_;
		static std::map<std::string, Tryte_t> symbols;
		std::string assembleSig1(const int&) const;
		std::string assembleSigI(const int&) const;
		std::string assembleSigR(const int&) const;
		std::string assembleSig2(const int&) const;
};

Reg_t getReg(const std::string&);
bool isDecString(const std::string&);
Tryte_t decStringToInt(const std::string&);
std::string intToDecString(const Tryte_t&);
std::string intToTerString(const Tryte_t&);

#endif

